﻿using OnlineOrder.Entity;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace OnlineOrder.UI.用户窗体
{
    public partial class DingDan : Form
    {
        public DingDan()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            ShoppingCar car = new ShoppingCar();
            this.Close();
            car.Show();
        }

        private void linkLabel1_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            MessageBox.Show("取消成功");
            this.Close();
        }

        private void DingDan_Load(object sender, EventArgs e)
        {
            string username = Middle.a;

            try
            {
                string sql = string.Format($"select place,username,tele from [User] where username='{username}'");

                DataTable dataTable = Utils.SqlHelper.ExecuteDataTable(sql);

                this.label10.Text =dataTable.Rows[0][0].ToString();
                this.label9.Text = dataTable.Rows[0][1].ToString();
                this.label8.Text = dataTable.Rows[0][2].ToString();
                
            }
            catch (Exception)
            {

                throw;
            }

        }

        private void panel2_Paint(object sender, PaintEventArgs e)
        {

        }

        private void dataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {

        }
    }
}
